<?php
include "counter2.php";

pagestart();
print "\n<html>\n";
pagehead(_("Personal registration"));
print "\n<BODY bgcolor=\"white\">";
pagetop(_("Personal registration"));

#  print "Test: $login";
#  print "Test: " . currentuser() . " ";
if ($login) { 
print "<hr>\n" .
"<strong>" . _("You are already registered and logged in as user #") . currentuser() . ".</strong><p>\n" .
_("If you register again, you will be logged in as a new user.") . "\n<br>\n" .
_("Make very sure this is what you intend to do.") .
"\n<hr>\n";
}

print "<FORM METHOD=POST action=\"/perl/validate.pl\">" .
_("In the form below you can enter the information about yourself, the Linux user who is filling out this form.") .
"\n<br>\n" .
_("The permitted use of this info is described in the") .
" <a href=\"organization/privacy.php\">" . _("privacy statement") . "</a> " . _("for the counter.");

print "\n<HR>\n" .
"<h2>" . _("Identification") . "</h2>" .
"\n<p>\n";

print "<iMG SRC=\"/gifs/greendot.gif\" ALT=\"\"><b>" . _("Email address") . ":</b>\n" .
"<inPUT NAME=\"sendreplyto\" SIZE=60 MAXLENGTH=160><P>" .
_("MUST BE FILLED IN! The counter will reject registrations where this is left blank or is invalid. This email address will NOT be revealed by the counter, but mail will be sent to it whenever the record is changed.");

print "\n<HR>\n" .
"<h2>" . _("Personal information") . "</h2>" .
"\n<p>\n" .
"<table border=4>" .
"\n<tr><td>" .
"\n<iMG SRC=\"/gifs/yellowdot.gif\" ALT=\"\">" .
"\n<B>" . _("Name") . ":</B></td>" .
"\n<td colspan=2><inPUT NAME=\"name\" SIZE=40 MAXLENGTH=40></td>" .
"\n</tr>";

print "<tr><td><iMG SRC=\"/gifs/yellowdot.gif\" ALT=\"\"><B>" . _("E-mail") . ":</B></td>" .
"\n<td colspan=2>\n <inPUT NAME=\"email\" SIZE=40 MAXLENGTH=160></td>" .
"\n<td>" . _("Your E-mail address, as you want it to be seen. Enter SECRET in order not to reveal it.") . "<br></td>" .
"\n</tr>";
print "<tr><td><img src=\"/gifs/yellowdot.gif\" alt=\"\"><b>" . _("Homepage") . ":</b></td>";
print "\n<td colspan=2><input name=\"homepage\" Size=40 maxlength=160></td>" .
"\n<td>" . _("Your personal Web page, if any") . "</td>" .
"\n</tr>" .
"\n<tr>\n<td><iMG SRC=\"/gifs/yellowdot.gif\" ALT=\"\"><B>" . _("Country") . ":</B></td>" .
"\n<td>";

if (preg_match("/^Mozilla\/4\./", $HTTP_USER_AGENT)) {
  print "<select name=\"country\" size=5>\n";
} else {
  print "<select name=\"country\">\n";
}

  print "<option value=\"\">Not given</option>\n";
  $q = mysql_query("select name, longname from places where type = 'country' order by users desc limit 5");
  while ($arr = mysql_fetch_array($q)) {
	print "<option value=\"$arr[name]\">$arr[longname]</option>\n";
  }
  print "<option value=\"\">------------</option>\n"; # Divider line in list
  $q = mysql_query("select name, longname from places where type = 'country' order by longname");
  while ($arr = mysql_fetch_array($q)) {
	print "<option value=\"$arr[name]\">$arr[longname]</option>\n";
  }

print "\n</select>\n</td>\n" .
"<td colspan=2>" . _("Country you live in. Mail") . emailCloaking("help@counter.li.org",0) . _("if you can't find your country in the list.") .
"\n<br>\n</td>" .
"\n</tr>";

print "\n<tr>\n<td>" .
"<iMG SRC=\"/gifs/yellowdot.gif\" ALT=\"\"><B>" . _("State/province/department") . ":</B></td>" .
"\n<td colspan=2><inPUT NAME=\"state\" SIZE=40 MAXLENGTH=40></td>" .
"\n<td>" .
_("State, province, department or region of the country. Some country lists can be found") . " <a href=\"/field-guide.php#state\">" . _("here") . "</a>.<br></td>" .
"\n</tr>";

print "\n<tr>\n<td><iMG SRC=\"/gifs/yellowdot.gif\" ALT=\"\"><B>" . _("City") . ":</B></td>" .
"\n<td colspan=2><inPUT NAME=\"city\" SIZE=40 MAXLENGTH=40></td>" .
"\n<td>" . _("City where you live. Use your native spelling (K&oslash;benhavn, not Copenhagen). Do NOT include the zip code.") . "<br>\n</td>" .
"\n</tr>";

print "\n<tr>\n<td><iMG SRC=\"/gifs/yellowdot.gif\" ALT=\"\"><B>" . _("Startdate") . ":</B></td>" .
"\n<td>" .
"\n<select name=\"started-month\">" .
"\n<option value=\"jan\" selected>" . _("January") . "</option>" .
"\n<option value=\"feb\">" . _("February") . "</option>" .
"\n<option value=\"mar\">" . _("March") . "</option>" .
"\n<option value=\"apr\">" . _("April") . "</option>" .
"\n<option value=\"may\">" . _("May") . "</option>" .
"\n<option value=\"jun\">" . _("June") . "</option>" .
"\n<option value=\"jul\">" . _("July") . "</option>" .
"\n<option value=\"aug\">" . _("August") . "</option>" .
"\n<option value=\"sep\">" . _("September") . "</option>" .
"\n<option value=\"oct\">" . _("October") . "</option>" .
"\n<option value=\"nov\">" . _("November") . "</option>" .
"\n<option value=\"dec\">" . _("December") . "</option>" .
"\n</select>" .
"\n<select name=\"started-year\">" .
"\n<option value=\"1991\">1991</option>" .
"\n<option value=\"1992\">1992</option>" .
"\n<option value=\"1993\">1993</option>" .
"\n<option value=\"1994\">1994</option>" .
"\n<option value=\"1995\">1995</option>" .
"\n<option value=\"1996\">1996</option>" .
"\n<option value=\"1997\">1997</option>" .
"\n<option value=\"1998\">1998</option>" .
"\n<option value=\"1999\" selected>1999</option>" .
"\n<option value=\"2000\">2000</option>" .
"\n<option value=\"2001\">2001</option>" .
"\n<option value=\"2002\">2002</option>" .
"\n<option value=\"2003\">2003</option>" .
"\n<option value=\"2004\">2004</option>" .
"\n<option value=\"2005\">2005</option>" .
"\n<option value=\"2006\">2006</option>" .
"\n<option value=\"2007\">2007</option>" .
"\n</select></td>" .
"\n<td colspan=2>\n" .
_("When you started using Linux") . "<br>\n" .
_("Linux 0.01: Sep 91") . "<br>\n" .
_("Linux 2.0.0: June 1996") . "<br>\n" .
_("See the") . " <a href=\"\">" .
_("Kernel History") . "</a> " . _("(currently unavailable) for more detail") .
"\n<br>\n</td>" .
"\n</tr>";

print "\n<tr>\n<td><iMG SRC=\"/gifs/yellowdot.gif\" ALT=\"\"><B>" . _("Usage") . ":</B></td>" .
"\n<td colspan=2>" .
"\n<input name=\"usage\" type=checkbox value=\"Home\">" . _("At Home") .
"\n<input name=\"usage\" type=checkbox value=\"School\">" . _("At School") .
"\n<input name=\"usage\" type=checkbox value=\"Work\">" . _("At Work") .
"\n</td>" .
"\n<td>" . _("Mark one or more") .
"\n<br>\n</td>" .
"\n</tr>";

print "\n<tr>\n<td><iMG SRC=\"/gifs/yellowdot.gif\" ALT=\"\"><B>" . _("May publish") . ":</B></td>" .
"\n<td colspan=2>" .
"\n<inPUT NAME=\"may_publish\" type=radio value=Yes><b>" . _("Yes") . "</b>, " . _("include my name and e-mail in the listings") . "<br>" .
"\n<inPUT NAME=\"may_publish\" type=radio value=No><b>" . _("No") . "</b>, " . _("I want to be an anonymous statistic") .
"\n</td>\n</tr>" .
"\n</table>" .
"\n<HR>" .
"\n<inPUT TYPE=\"submit\" VALUE=\"" . _("Enter!") . "\"><inPUT TYPE=\"reset\" VALUE=\"" . _("Clear") . "\">" . 
"\n</FORM>\n";

pagebottom("yes");
print "\n</BODY>\n</HTML>";
?>
